
#include <iostream>
#include "SDL/SDL.h"

using namespace std;

SDL_Event event;
SDL_Surface *screen;

int main(int argc, char* args[]){
	
	screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE);

	int x = 0;
	int y = 0;
	int button;

	SDL_Init(SDL_INIT_EVERYTHING);

	int loop = true;

	while (loop){

		if (SDL_PollEvent(&event)){

			if(event.type == SDL_MOUSEBUTTONDOWN){

				if(event.button.button == SDL_BUTTON_LEFT)
					printf("SDL_BUTTON_LEFT");

				if(event.button.button == SDL_BUTTON_MIDDLE)
					printf("SDL_BUTTON_MIDDLE");

				if(event.button.button == SDL_BUTTON_RIGHT)
					printf("SDL_BUTTON_RIGHT");

				if(event.button.button == SDL_BUTTON_WHEELUP)
					printf("SDL_BUTTON_WHEELUP");

				if(event.button.button == SDL_BUTTON_WHEELDOWN)
					printf("SDL_BUTTON_WHEELDOWN");
			}

			if(event.type == SDL_MOUSEMOTION){

					cout << "x = " << event.motion.x << ", y = " << event.motion.y;
					cout << ", xrel = " << event.motion.xrel << ", yrel = " << event.motion.yrel << endl;
			}
		}
	}

	return 0;
}